<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateMaterialPurchasesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('material_purchases', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('material_id')->default(0)->comment('关联devices表的id');
			$table->integer('sku')->default(0)->comment('采购数量');
			$table->integer('stock')->default(0)->comment('库存数量');
			$table->string('buyer', 50)->nullable()->comment('采购人');
			$table->dateTime('purchase_at')->default('1970-01-02 00:00:00')->comment('采购日期');
			$table->string('remark')->nullable()->comment('备注');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('material_purchases');
	}

}
